package edu.gznu.ics.fast.pulsar.controller.prestoacc.picController;


import edu.gznu.ics.fast.pulsar.model.vo.web.MatchQueryVO;
import edu.gznu.ics.fast.pulsar.service.prestoacc.picService.MatchQueryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;


/**
 * Created by fei-zyx on 2016/10/19.
 */
@Controller

public class MatchQueryController {

    @Autowired

    private MatchQueryService matchQueryService;

    @RequestMapping(method = RequestMethod.POST, value = "/matchQuery", produces = "application/json;charset=UTF-8")
    @ResponseBody
    public List<MatchQueryVO> compareQuery(@RequestBody MatchQueryVO obj){


        List<MatchQueryVO> list=new ArrayList<>();
        list=matchQueryService.queryByPicAndFits(obj);
        return list;

    }
    @RequestMapping(method = RequestMethod.POST, value = "/matchKnownQuery", produces = "application/json;charset=UTF-8")
    @ResponseBody
    public List<MatchQueryVO> matchKnownQuery(@RequestBody MatchQueryVO obj){


        List<MatchQueryVO> list=new ArrayList<>();
        list=matchQueryService.queryByPicAndFits(obj);
        return list;

    }

}

